<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        $schedule->command('sync:msg_task')->everyFiveMinutes();
        $schedule->command('sync:config')->everyMinute();
        //1个小时更新一下redis的 device和account到数据库
//        $schedule->command('sync:account')->hourly();
//        $schedule->command('sync:device')->hourly();
        //5分钟同步一下任务日志
        $schedule->command('sync:msglog')->everyFiveMinutes();
        //每五分钟看一下机器
        $schedule->command('calculate:device')->everyFiveMinutes();
        //每小时重组
        $schedule->command('account_queue:rebuild')->hourly();
        $schedule->command('clear:machine')->dailyAt('0:01');
        //5分钟盘算一下没有回执的
        $schedule->command('sync:old_device')->everyTenMinutes();
        $schedule->command('sync:old_account')->everyTenMinutes();
        $schedule->command('delete:msgtask')->dailyAt('13:32');
    }
    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        $this->load(__DIR__ . '/Commands');

        require base_path('routes/console.php');
    }
}
